﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WebConsumer
{
    public partial class getArt : Form
    {
        public getArt()
        {
            InitializeComponent();
        }

        private Artista.ArtistaWeb remoteArt;

        private void getArt_Load(object sender, EventArgs e)
        {
            textBox1.Text = "Escreva nome a procurar...";
            button1.Text = "Search";
        }

        private void button1_Click(object sender, EventArgs e)
        {
            remoteArt = new WebConsumer.Artista.ArtistaWeb();
            showArt sa;
            WebConsumer.Artista.ArtistaS h = new WebConsumer.Artista.ArtistaS(); ;
            try
            {
                h = remoteArt.getArtista(textBox1.Text);
                this.Hide();
                sa = new showArt(h);
                sa.Show();
            }
            catch(Exception ex)
            {
                errorProvider1.SetError(textBox1, "Artista não encontrado");
                textBox1.Text = "";
            }
                
        }

        private void atrasToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Hide();
            Form1 f = new Form1();
            f.Show();
        }

       
    }
}
